/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model.creature.sprite.plugin;

import java.awt.Image;
import model.creature.moving_creature.ActionType;
import model.creature.moving_creature.Direction;
import model.creature.sprite.DefaultSprite;
import model.game.GameInterface;
import model.map.cell.Cell;
import model.map.cell.PlantableCell;
import model.utility.ImageUtility;

/**
 *
 * @author dolphinigle
 */
public class WaterSprite extends DefaultSprite {

  /**
   * Constructor
   */
  public WaterSprite(GameInterface game) {
    super(game, game.getMaps().getField().getCellAt(1,1));
  }

  @Override
  public int getHiringPrice() {
    return 400 + getLevel() * 200;
  }

  @Override
  public String getName() {
    return "Water Sprite";
  }

  @Override
  public String getDescription() {
    return "Lv: " + getLevel() + ", MaxHP: " + getMaxHP() + ", " +
    "Waters your crop. Without upgrades, fragile at night";
  }

  @Override
  public Image getImage() {
    return ImageUtility.loadImage("resources/pictures/water_sprite/sprite.png");
  }

  @Override
  public boolean canUpgrade() {
    if (getLevel() < 10) return true;
    return false;
  }

  @Override
  public int getUpgradeCost() {
    return 100;
  }

  @Override
  public int getMaxHP() {
    return 200 + getLevel() * 200;
  }

  @Override
  protected ActionType getActionType(Cell cell, Direction dir) {
    return ActionType.kActionWater;
  }

  @Override
  protected int howImportantIsFacingThis(Cell cell) {
    if (game_.isNight()) return 0;
    if (!cell.isPlantable()) return 0;
    PlantableCell pc = (PlantableCell) cell;
    if (pc.isWatered()) return 0;
    if (!pc.isPlanted()) return 0;
    return 1;
  }

  @Override
  protected int howImportantIsBeingHere (Cell cell, Direction dir) {
    return 0;
  }

}
